package org.dpes.compare.compareManager;

import java.io.File;

import org.dpes.compare.CmpResult;
import org.dpes.compare.AComparator.CmpType;
import org.dpes.compare.utils.TimeUtil;

public class Task {
	
	private File left;
	private File right;
	private CmpType type;
	
	public Task(File left, File right, CmpType type) {
		setCreateTime();
		this.left = left;
		this.right = right;
		this.type = type;
	}
	
	public File getLeft() {
		return left;
	}
	public File getRight() {
		return right;
	}
	public CmpType getType() {
		return type;
	}
	
	private long createTime;
	
	void setCreateTime() {
		if (createTime == 0)
			this.createTime = TimeUtil.currentTime();
	}

	public long getCreateTime() {
		return createTime;
	}


	private long acceptedTime;

	void setAcceptedTime() {
		if (acceptedTime == 0)
			this.acceptedTime = TimeUtil.currentTime();
	}

	public long getAcceptedTime() {
		return acceptedTime;
	}

	private long jobStartTime;
	
	void setJobStartTime() {
		if (jobStartTime == 0)
			this.jobStartTime = TimeUtil.currentTime();
	}

	public long getJobStartTime() {
		return jobStartTime;
	}

	private long jobFinishTime;
	
	void setJobFinishTime() {
		if (jobFinishTime == 0)
			this.jobFinishTime = TimeUtil.currentTime();
	}

	public long getJobFinishTime() {
		return jobFinishTime;
	}

	private CmpResult result;
	
	void setResult(CmpResult result) {
		this.result = result;
	}

	public CmpResult getResult() {
		return result;
	}
	
	private long ID;

	void setID(long id) {
		if (ID == 0)
			this.ID = id;
	}
	public long getID() {
		return ID;
	}
}
